<?php
/**
 * Created by PhpStorm.
 * User: moquan
 * Date: 2018/5/26
 * Time: 17:16
 */

namespace app\api\controller;
use think\Controller;
use think\Request;

class Base extends Controller{

    public function __construct(Request $request = null) {
        parent::__construct($request);

    }

    public function _initialize() {
        parent::_initialize(); //
        $module = $this->request->module();
        $controller = $this->request->controller();
        $action = $this->request->action();

        //过滤不需要登陆的行为
       /* if ( !in_array( $action, array('login', 'test') ) || in_array( $controller, array('test') ) ) {
            if ( session('admin_id') ) {
                //$this->check_priv();//检查管理员菜单操作权限
            }else {
                //(ACTION_NAME == 'index') && $this->redirect( U('Admin/Admin/login'));
                $this->error('请先登录', url('Admin/Admin/login'), null, 1);
            }
        }*/
    }


}